var a=0;
function adds()
{
	var selectAll=document.getElementsByName("selectAll");
	var select=document.getElementsByName("select");
	var num=document.getElementById("num");
	num.value=parseInt(num.value)+1;
	a=parseFloat(699.00)*parseFloat(num.value);
	
	document.getElementById("price").innerHTML=a+"元";
	document.getElementById("jifen").innerHTML=a;
	if(selectAll[0].checked==true)
	{document.getElementById("sum1").innerHTML="总计"+a+"元";
	document.getElementById("sum2").innerHTML="获得积分"+a;}
	else
	{document.getElementById("sum1").innerHTML="总计"+0+"元";
	document.getElementById("sum2").innerHTML="获得积分"+0;}

}
function minuss()
{
	var selectAll=document.getElementsByName("selectAll");
	var select=document.getElementsByName("select");
	var num=document.getElementById("num");
	if(parseInt(num.value)>1)
	{
		num.value=parseInt(num.value)-1;
	}
	else 
	{
		num.value=1;
	}
		a=parseFloat(699.00)*parseFloat(num.value);
	
	document.getElementById("price").innerHTML=a+"元";
	document.getElementById("jifen").innerHTML=a;
	var selectAll=document.getElementsByName("selectAll");
	if(selectAll[0].checked==true)
	{document.getElementById("sum1").innerHTML="总计"+a+"元";
	document.getElementById("sum2").innerHTML="获得积分"+a;}
	else
	{document.getElementById("sum1").innerHTML="总计"+0+"元";
	document.getElementById("sum2").innerHTML="获得积分"+0;}
}
function get()
{
	var selectAll=document.getElementsByName("selectAll");
	var select=document.getElementsByName("select");
	for(var i=0;i<select.length;i++)
	{
		select[i].checked=selectAll[0].checked;
	}
	if(selectAll[0].checked==true)
	{document.getElementById("sum1").innerHTML="总计"+a+"元";
	document.getElementById("sum2").innerHTML="获得积分"+a;}
	else
	{document.getElementById("sum1").innerHTML="总计"+0+"元";
	document.getElementById("sum2").innerHTML="获得积分"+0;}
}
function release()
{
	var selectAll=document.getElementsByName("selectAll");
	var select=document.getElementsByName("select");
	for(var i=0;i<select.length;i++)
	{
		if(select[i].checked==false)
		selectAll[0].checked=false;
		
	}
	if(select[0].checked==true)
//	 && select[1].checked && select[2].checked && select[3].checked
		selectAll[0].checked=true;
	if(selectAll[0].checked==true)
	{document.getElementById("sum1").innerHTML="总计"+a+"元";
	document.getElementById("sum2").innerHTML="获得积分"+a;}
	else
	{document.getElementById("sum1").innerHTML="总计"+0+"元";
	document.getElementById("sum2").innerHTML="获得积分"+0;}
}
